package mqtt

func Push(topic, payload string, qos int64, retain bool) error {
	err := Create().
		SetQos(qos).
		SetTopic(topic).
		SetPayload(payload).
		SetRetain(retain).
		Push()
	if err != nil {
		return err
	}

	return nil
}

func IsOnline(client_id string) bool {
	session, err := Create().Connection(client_id)
	if err != nil || session == nil {
		return false
	}
	return true
}
